<%@ page language="java" import="java.util.*" pageEncoding="utf8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="com.niit.bc.util.web.Constants" %>

<script type="text/javascript">
    function quit() {
        if (confirm("如果你想退出系统,请按确定,如果想继续使用本系统,请按取消!")) {
            var xmlHttpReq = null;
            if (window.XMLHttpRequest) {
                xmlHttpReq = new XMLHttpRequest();
            }
            if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlHttpReq.open('GET', 'QuitLogin', true);//提交方式、地址和参数、是否异步提交
            xmlHttpReq.onreadystatechange = callback; //设置回调函数
            xmlHttpReq.setRequestHeader("if-Modified-since", "0");//设置不使用浏览器缓存
            xmlHttpReq.send(null);//发送请求

        }
    }

    function callback() {
        if (4 == xmlHttpReq.readyState && 200 == xmlHttpReq.status) {
            window.opener = null;
            window.parent.close();
        } else {
            self.location = "Index";
        }
    }

    function checkUser() {
        alert("请登录后查看");
        return;
    }
</script>

<!-- 顶部开始 -->
<div class="ks7hd">
    <div class="topbox">
        <div class="ks7l">
            <script src="/user/userlogin.asp?action=script" type="text/javascript"></script>
        </div>
        <div class="ks7r">
            <a href="Index" target="_blank">淘书城首页</a> |
            <a href="bottom/Foot.html">帮助</a> |
            <c:if test="${niit_bc_user != null }">
                <a href="Index" target="_top" onclick="quit()">退出</a> |
                <a>${niit_bc_user.userName },欢迎您第${niit_bc_user.userLoginTime }登录</a><br/>
            </c:if>
            <c:if test="${niit_bc_user == null }">
                <a href="login.jsp">请登录</a>
            </c:if>
        </div>
    </div>
</div>
<!-- 顶部结束 -->
<div class="clear"></div>
<!--头部 logo -->
<div class="head">
    <div class="logo"><img src="images/logo.png" alt="淘书城首页"/></div>
    <div class="nav">
        <ul>
            <li><a href="#"><img src="images/top_nav1.gif"/></a><br/><a href="#">新书资讯</a></li>
            <li><a href="BookAllList"><img src="images/top_nav2.gif"/></a><br/><a href="BookAllList">图书浏览</a></li>
            <li><a href="BookAllList"><img src="images/top_nav3.gif"/></a><br/><a href="BookAllList">书目列表</a></li>
            <li><a href="Index"><img src="images/top_nav5.gif"/></a><br/><a href="Index">淘书城</a></li>
            <li><a href="bottom/Foot.html" target="_blank"><img src="images/top_nav6.gif" width="49"
                                                                height="49"/></a><br/><a href="bottom/Foot.html"
                                                                                         target="_blank">书城答疑</a></li>
        </ul>
    </div>
</div>
<div class="clear"></div>
<!--头部频道导航-->
<!--频道导航-->
<div class="navtop">
    <ul>
        <li class="currclass"><a href="Index">首页</a></li>
        <li><a href="BookAllList">全部图书</a></li>
        <c:if test="${listType != null}">
            <c:forEach items="${listType }" var="listType">
                <li><a href="BookList?typeId=${listType.typeId }">${listType.typeName }</a></li>
            </c:forEach>
        </c:if>
        <li><a href="#">订单查询</a></li>
        <li><a href="Cart">购物车</a></li>
        <c:if test="${niit_bc_user != null }">
            <li><a href="OrderSearch?userId=${niit_bc_user.userId }">我的订单</a></li>
        </c:if>
        <li><a href="FindListType">图书增加</a></li>
    </ul>
</div>
<div class="clear"></div>
<!--顶部搜索-->
<div class="nav_head">
    <div class="searchmain">
        <div class="shopfl">
            <div class="shopfltitle">
                <script src="js/2.js" type="text/javascript"></script>
            </div><!--2.js为显示时间-->
        </div>
        <div class="searchbox">
            <form action="SearchBook" method="post" name="ty">
                <div class="searchtext"><input type="text" name="key" value="请输入要搜索的图书名称关键字"
                                               onFocus="if(this.value=='请输入要搜索的图书名称关键字'){this.value='';}"
                                               style="border:0px;margin-top:3px;height:21px;line-height:21px;color:#999;width:340px;">
                </div>
                <div class="searchbut"><input type="image" src="images/searchbut.gif" align="absmiddle"
                                              onfocus="submit"/></div>
            </form>
        </div>
        <div class="searchr">
            <div class="spcart">
                <ul>
                    <li>
                        <img src="images/5.gif"/>
                        <a href="Cart" target="_blank">购物车
                            <span style="color:#ff0000" id="myCart">
								<c:if test="${niit_bc_cart != null }">${niit_bc_cart.bookNum}</c:if>
								<c:if test="${niit_bc_cart == null }">0</c:if>
							</span>件商品
                        </a>
                    </li>

                    <c:if test="${niit_bc_user != null }">
                        <li><a href="OrderSearch?userId=${niit_bc_user.userId }" target="_blank">我的订单</a></li>
                    </c:if>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--顶部搜索-->
<div class="clear"></div>
<!--广告一-->
<div class="shopad1"><a href="#" target="_blank"><img src="images/lbao.jpg" alt="taobook" width="960"></a></div>
<div class="clear"></div>

